<?php


class View extends CI_Controller{
	
	public function petitionByID($id){
		get_instance()->load->model('petitions/Petition');
		if (!$data['petition'] = get_instance()->Petition->getPetition($id)){
			 $this->petition404();
			 return;
		}
		// Else
		
		$data['content'] = get_instance()->load->view('content/petition-view-content', $data, TRUE);
		get_instance()->load->view('templates/layout', $data);
		
	}
	
	public function petition404(){
		echo '404';
	}
}